package org.xdq.单例模式.懒汉式;

public class Instance {

    private static Instance instance;

    private Instance(){
        System.out.println("懒汉式单例对象创建了！");
    }

    public synchronized static Instance getInstance(){

        if(instance == null){
            instance = new Instance();
        }
        return instance;

    }

}
